package main;

import java.util.Comparator;

import com.google.common.collect.Multiset;
import com.google.common.collect.Multiset.Entry;

public class CountComporator implements Comparator<Multiset.Entry<String>> {
  @Override
  public int compare(Entry<String> o1, Entry<String> o2) {
    if (o1.getCount() != o2.getCount()) {
      return -o1.getCount() + o2.getCount();
    }
    return o1.getElement().compareTo(o2.getElement());
  }
}